package com.ioc.business.order.domain.bo.delivery;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ioc.business.order.enums.OrderStatusEnum;
import com.ioc.common.validate.AddGroup;
import com.ioc.common.validate.EditGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
@Data
public class DeliveryOrderBo {
    /**
     * 发货订单ID
     */
    @NotNull(message = "收货订单ID不能为空", groups = {EditGroup.class})
    private Long deliveryOrderId;

    /**
     * 单号
     */
    @NotBlank(message = "发货单号不能为空", groups = {AddGroup.class, EditGroup.class})
    private String orderCode;

    /**
     * 客户Id
     */
    @NotNull(message = "客户Id不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long customerId;

    /**
     * 客户名称
     */
    @NotBlank(message = "客户名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String customerName;

    /**
     * 物料名称
     */
    @NotBlank(message = "物料名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String materialName;

    /**
     * 描述
     */
    private String desc;

    /**
     * 物料数量
     */
    @NotNull(message = "物料数量不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer materialQuantity;

    /**
     * 重量(吨)
     */
    @NotBlank(message = "重量(吨)不能为空", groups = {AddGroup.class, EditGroup.class})
    private String weight;

    /**
     * 发货时间
     */
    @NotNull(message = "发货时间不能为空", groups = {AddGroup.class, EditGroup.class})
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date deliveryTime;

    /**
     * 预计完成时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date estimatedFinishTime;

    /**
     * 负责人
     */
    @NotBlank(message = "负责人不能为空", groups = {AddGroup.class, EditGroup.class})
    private String principal;

    /**
     * 任务进度
     */
    @NotBlank(message = "任务进度不能为空", groups = {AddGroup.class, EditGroup.class})
    private String taskProgress;

    /**
     * 发货状态
     */
    @NotNull(message = "发货状态不能为空", groups = {AddGroup.class, EditGroup.class})
    private OrderStatusEnum deliveryStatus;

    /**
     * 运输状态
     */
    @NotNull(message = "运输状态不能为空", groups = {AddGroup.class, EditGroup.class})
    private OrderStatusEnum transportStatus;
}
